#include "nuages.h"

#include <GL/glut.h>
#include <iostream>
#include "scene.h"

using namespace std;

Nuages::Nuages(Vent * v):_vent(v),_ciel(NULL)
{
  _ciel = new Plan(60,60,"clouds2.jpg");
 (_ciel->getTexture())->setModePlaquage(GL_REPLACE);
  setPosition(0.0,0.0,-20.0);
}

Nuages::~Nuages()
{
  if(_ciel)
    delete _ciel;
}

void Nuages::onTimerEvent(int)
{
//	cout << _vent->getForce() <<endl;
	Scene::updateDefil(_vent->getForce());
}

void Nuages::display()
{
  glPushMatrix();
  _draw();
  glPopMatrix();
}
void Nuages::_draw()
{
    glTranslatef(0.0,0.0,-20.0);
    glRotatef(-3.6877,0.0,0.0,1.0);
    glRotatef(73.0,1.0,0.0,0.0);
    _ciel->displayAnimated();
}

